package com.halflife.message;

import com.halflife.framework.domain.BaseDomain;
import com.halflife.comeElectricity.admin.NavStatic;
import com.halflife.comeElectricity.member.rider.Rider;
import com.halflife.comeElectricity.orderMng.order.Order;
import com.halflife.comeElectricity.orderMng.order.OrderEnum;

/**
 * Created by Administrator on 2018/4/2 0003.
 */
public class OrderMessage extends BaseDomain {

    public static  final Byte STATUS_NORMAL = 0;
    public static  final Byte STATUS_FINISHED = 1;

    private Integer id;
    private Integer merchantId;//商户Id
    private Integer riderId;//骑手Id
    private String memo;//备注
    private Byte status;//状态
    private String spare;//冗余字段

    public OrderMessage(){}

    public OrderMessage(Rider rider,Order order){

        if(rider.getId()!=null)
            this.setRiderId(rider.getId());
        if(order!=null && order.getMerchantId()!=null)
            this.setMerchantId(order.getMerchantId());
        this.status = OrderEnum.WAITTOGET.m_orderStatus.byteValue();
        this.spare = "您于"+ NavStatic.getDate(order.getCreateTime()) +"下的订单，已经被骑手"+ rider.getName() +
                "抢单.骑手电话"+ rider.getPhone() +".";
        this.memo = "您于"+ NavStatic.getDate(order.getCreateTime()) +"下的订单，已经被骑手"+ rider.getName() +
                "抢单.骑手电话"+ rider.getPhone() +".";
    }
    @Override
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Integer merchantId) {
        this.merchantId = merchantId;
    }

    public Integer getRiderId() {
        return riderId;
    }

    public void setRiderId(Integer riderId) {
        this.riderId = riderId;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public String getSpare() {
        return spare;
    }

    public void setSpare(String spare) {
        this.spare = spare;
    }
}
